#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>

	long	app[3100];
	long	seq[3100];
	long	n;

main()
{
	long	i,j,k;
	long	suc;

	while (scanf("%ld",&n)!=EOF)
	{
	//	if (n<=0 || n>=3000) break;
		for (i=1;i<=n;i++)
			scanf("%ld",seq+i);
		suc=1;
		memset(app,0,sizeof(app));
		for (i=2;i<=n;i++)
		{
			k=abs(seq[i]-seq[i-1]);
			if (k<n) app[k]=1; else suc=0;
		}
		for (i=1;i<n && suc;i++)
			if (app[i]==0)
				suc=0;
		if (suc) printf("Jolly\n"); else printf("Not jolly\n");
	}
	return 0;
} 



